<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml"
      xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>用款申请-详细</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=f5a12a1d">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style type="text/css">
        .blockElement {
            position: fixed !important;
            top: 50% !important;
        }

        .user {
            height: 30px;
            line-height: 30px;
            max-height: 30px;
            float: left;
            text-align: left;
            min-width: 32px;
            padding-left: 1px;
            overflow: hidden;
            cursor: pointer;
        }

        .table-detail td.td-value2 {
            padding: 1px !important;
            text-align: left !important;
        }

        .pull-left {
            float: left;
            padding-left: 6px;
        }

        .td-value2 input {
            box-shadow: inset 1px 1px 4px #333;
            height: 100% !important;
            padding-left: 4px !important;
        }

        .td-value2 select {
            box-shadow: inset 1px 1px 4px #333;
            height: 100% !important;
            padding-left: 4px !important;
            color: #2a8cec;
        }

        .lineOne {
            text-align: left;
        }

        .td-value span.lineOne {
            overflow: hidden;
            text-overflow: ellipsis;
            color: black !important;
            /*display: -webkit-box;*/
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            max-height: 34px;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .user:hover {
            background-color: #cfd4d1;
        }

        .userbox .select.user {
            color: #fff;
            background-color: #045B9E;
        }

        .span-btn {
            position: absolute;
            left: 27px;
            margin-top: 0px;
            cursor: pointer;
        }

        .auditorName {
            text-align: center;
        }

        .IcoNormal {
            float: left;
            border-bottom: 0px;
            border-left: 0px;
            background-color: transparent;
            width: 16px;
            height: 16px;
            vertical-align: middle;
            border-top: 0px;
            border-right: 0px;
            background-image: url(/dist/img/upload_normal.gif);
            background-repeat: no-repeat;
            float: left;
        }

        .progressobj {
            height: 20px;
        }

        .progressobj .delfile {
            float: left;
            margin-left: 10px;
        }

        .select {
            color: #fff;
            background-color: #045B9E;
        }

        td .sp-value {
            display: inline-block;
            padding-left: 6px;
            word-wrap: break-word;
        }

        td {
            color: #2a8cec;
        }

        td.td-title, td select, td .filename, td.td-module {
            color: black;
        }

        .table-detail-payee:nth-child(even) td.td-title {
            background-color: white;
        }

        .printDiv {
            display: none;
        }

        .printInput {
            width: 200px;
        }

        .printBtn {
            margin: 0 auto;
            display: block;
        }

        .webuploader-pick {
            background: url(/dist/img/fjT1.png) no-repeat 5px center;
            display: block;
            padding: 0 4px;
            height: 22px;
            line-height: 22px;
            padding-left: 15px;
            margin: 0 auto;
            width: 70px;
            margin-top: 2px;
            border-radius: 4px;
        }

        .webuploader-pick-hover {
            color: #fff !important;
            background: url(/dist/img/fjT2.png) no-repeat 5px center;
            background-color: #0F6099;

        }

        #divUploadedFiles {
            /*padding: 4px;*/
            padding-bottom: 0;
        }

        .jiaobiao3 {
            position: relative;
        }

        .jiaobiao3 i {
            display: block;
            width: 6px;
            height: 6px;
            background: url("/dist/img/newLog3.png");
            position: absolute;
            top: 0px;
            right: 0px;
        }

        .moreListData {
            position: absolute;
            top: 30px;
            z-index: 111;
            display: none;
        }

        table td.td-tanZongStyle-line span, table td.td-tanZongStyle-line div.wyui-autocomplete-panel {
            display: none;

        }

        .td-tanZongStyle-line textarea {
            box-shadow: inset 1px 1px 4px #333;
            display: block;
        }

        .td-tanZongStyle-line span {
            padding-left: 4px !important;
        }

        .table-detail td.td-tanZongStyle-line {
            height: 100% !important;
            padding: 1px !important;

        }

        .td-tanZongStyle-line select {
            box-shadow: inset 1px 1px 4px #333;
            padding-left: 4px;
            height: 34px;
            line-height: 34px;
            width: 100%;
            color: #2a8cec;
            box-shadow: inset 1px 1px 4px #333;
            padding-left: 4px !important;
            border: 1px solid rgb(238, 238, 238);
        }

        .moreListData .item {
            width: 100%;
            height: 30px;
            line-height: 30px;
        }

        .moreListData .item span {
            margin-right: 5px;
        }

        .table-my .title {
            width: 80px;
            text-align: center;
        }

        .ui_main {
            vertical-align: top;
        }

        .td-box {
            float: left;
            width: 100%;
            border: 1px solid #cbcbcb;
        }

        .td-tanZongStyle-line input {
            box-shadow: inset 1px 1px 4px #333;
            padding-left: 4px;
            height: 34px;
            line-height: 34px;
            width: 100%;
            color: #2a8cec;
            border: 1px solid rgb(238, 238, 238);

        }

        .title {
            text-align: center;
            width: 62px;
            height: 42px;
        }
    </style>
</head>
<body>
<iframe id="ifAttach" style="display:none"></iframe>
<div class="layout" style="left:0px;top:0px;right:0px;bottom:0px;" id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>
    <div class="center" style="overflow:auto;overflow-x:hidden;padding-left:8px;padding-right:8px;">
        <table cellspacing="0" class="table-my" style="margin-top: 20px;width: 100%">
            <tbody>
            <tr>
                <td class="title">设备类型</td>
                <td class="td-tanZongStyle-line">
                    <div class="td-box">
                        <select v-model="typeId" :checked="typeId" @change="getBrandListByTypeId()">
                            <option value=""></option>
                            <option v-for="(item,i) in typeList" :value="item.id">
                                {{item.typeName}}
                            </option>
                        </select>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="title">设备品牌</td>
                <td class="td-tanZongStyle-line">
                    <div class="td-box">
                        <select v-model="brandId" :checked="brandId">
                            <option value=""></option>
                            <option v-for="(item,i) in brandList" :value="item.brandId">
                                {{item.brandName}}
                            </option>
                        </select>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="title">设备型号</td>
                <td class="td-tanZongStyle-line">
                    <div class="td-box">
                        <input type="text" autocomplete="off" v-model="modelName">
                    </div>
                </td>
            </tr>
            </tbody>

        </table>
    </div>
    <div class="south no-print" style="height:50px;line-height:50px;text-align:center;">
        <input type="button" style="margin-left:20px;" @click="save()"
               value="保存" class="btn oaBtn btn-sm"/>
    </div>
</div>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=63aed32f"></script>

<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<!--ztree组件所需js-->
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.exhide-3.5.js"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script type="text/javascript" src="/dist/js/pages/apply/money/class.js"></script>
<script type="text/javascript" src="/dist/js/pages/system/systemService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/commonService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/changeMoneyToChinese.js"></script>
<script type="text/javascript" src="/dist/plugins/print/print.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });

</script>
<script type="text/javascript">
    var api = frameElement.api, W = api.opener;


    var app = new Vue({
        el: "#app",
        data: {
            userId: $.peiJian.page.urlParams.userId,
            brandId: $.peiJian.page.urlParams.brandId ? $.peiJian.page.urlParams.brandId : '',
            modelId: $.peiJian.page.urlParams.modelId ? $.peiJian.page.urlParams.modelId : '',
            modelName: $.peiJian.page.urlParams.modelName ? $.peiJian.page.urlParams.modelName : '',
            typeList: [],
            brandList: [],
            typeId: '',
        },
        methods: {

            save: function () {
                var that = this;
                var data = {
                    userId: that.userId,
                    typeId: that.typeId,
                    modelId: that.modelId,
                    brandId: that.brandId,
                    modelName: that.modelName
                };
                $.peiJian.postMethod(peiJianUrlConfig.device.saveDeviceModel, trimRN(data), function (data) {
                    if (data.id && data.id != '') {
                        alert("保存成功");
                    } else {
                        alert("保存失败");
                    }
                    var $iframe = top.findIframeByName("设备管理");
                    $iframe[0].contentWindow.$("#iframeBox")[0].contentWindow.refresh();
                    api.close();
                });
            },
            getBrandListByTypeId: function () {
                var that = this;
                $.peiJian.postMethod(peiJianUrlConfig.device.getBrandListByTypeId, {
                    userId: that.userId,
                    typeId: that.typeId,
                }, function (data) {
                    that.brandList = data.records;
                });
            },
        },
        mounted: function () {
            var that = this;
            that.typeId = $.peiJian.page.urlParams.typeId ? $.peiJian.page.urlParams.typeId : '',
                $.peiJian.postMethod(peiJianUrlConfig.device.getTypeList, {
                    userId: that.userId
                }, function (data) {
                    console.log(data);
                    that.typeList = data.records;
                });
            if (that.typeId && that.typeId != '') {
                that.getBrandListByTypeId();
            }
        }
    });
</script>

</body>
</html>